﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MedicinaMuncii.Entities.Company>"
    Theme="Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%: Resources.Global.CompanyCreatePageTitle %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        <%: Resources.Global.CompanyCreatePageTitle %>
    </h2>
    <% using (Html.BeginForm())
       {%>
    <%: Html.ValidationSummary(true) %>
    <table cellpadding="0" cellspacing="0">
        <tr>
            <td class="top-aligned">
                <fieldset>
                    <legend>
                        <%: Resources.Global.FieldsLabel %>
                    </legend>
                    <%: Html.HiddenFor(model => model.AddressID) %>
                    <table cellpadding="0" cellspacing="0" class="inputarea">
                        <tr>
                            <td>
                                <%: Resources.Global.NameLabel %>
                            </td>
                            <td>
                                <%: Html.TextBoxFor(model => model.Name) %>
                                <%: Html.ValidationMessageFor(model => model.Name) %>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <%: Resources.Global.ProfileLabel %>
                            </td>
                            <td>
                                <%: Html.TextBoxFor(model => model.Profile) %>
                                <%: Html.ValidationMessageFor(model => model.Profile) %>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <%: Resources.Global.UnitLabel %>
                            </td>
                            <td>
                                <%: Html.TextBoxFor(model => model.Unit) %>
                                <%: Html.ValidationMessageFor(model => model.Unit) %>
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </td>
            <td class="top-aligned" rowspan="2">
                <%= Html.EditorFor(model => model.address)%>
            </td>
        </tr>
        <tr>
            <td class="top-aligned">
                <fieldset>
                    <legend>
                        <%: Resources.Global.CompanyInsultsLabel %>
                    </legend>
                    <% Html.Telerik().Grid(ViewData["Insults"] as IEnumerable<Insult>).Name("Insults").Columns(columns =>
                    {
                        columns.Template(i =>
                        { %>
                    <%: Html.CheckBox(string.Format("Insult{0}", i.ID), false)%>
                    <% })
                            .Width(20)
                            .HtmlAttributes(new { @class = "center-aligned" });
                        columns.Bound(i => i.Name).Title(Resources.Global.NameLabel);
                    }).HtmlAttributes(new { @class = "containerwide" })
                    .Render();%>
                </fieldset>
            </td>
        </tr>
    </table>
    <div class="edit-button-bar">
        <button class="t-grid-action t-button t-state-default t-grid-update" type="submit">
            <span class="t-icon t-update"></span>
            <%: Resources.Global.CreateLabel %>
        </button>
        <a class="t-grid-action t-button t-state-default t-grid-cancel" href="<%=Url.Action("Index", "Company")%>">
            <span class="t-icon t-cancel"></span>
            <%: Resources.Global.CancelLabel %>
        </a>
    </div>
    <% } %>
</asp:Content>
